﻿using System.Windows;
using System.Windows.Controls;

namespace ModuleB.Views
{
    /// <summary>
    /// ModuleBView.xaml 的交互逻辑
    /// </summary>
    public partial class ModuleBView : UserControl
    {
        public ModuleBView()
        {
            InitializeComponent();
        }

        private void ListViewItem_Selected(object sender, RoutedEventArgs e)
        {
            if (GeneralSettings == null)
            {
                return;
            }
            if (sender is ListViewItem item)
            {
                switch (item.Tag.ToString())
                {
                    case "General":
                        GeneralSettings.Visibility = Visibility.Visible;
                        AboutSettings.Visibility = Visibility.Collapsed;
                        SettingTitle.Text = "常规设置";
                        break;

                    case "About":
                        GeneralSettings.Visibility = Visibility.Collapsed;
                        AboutSettings.Visibility = Visibility.Visible;
                        SettingTitle.Text = "关于系统";
                        break;

                    default:
                        GeneralSettings.Visibility = Visibility.Collapsed;
                        AboutSettings.Visibility = Visibility.Collapsed;
                        SettingTitle.Text = item.Content.ToString();
                        break;
                }
            }
        }
    }
}